import React from 'react'
// import {render} from 'react-dom'
import ReactDOM from 'react-dom';
import App from './components/app/app'
import 'antd/dist/antd.css';



import i18n from 'i18next';
import { useTranslation, initReactI18next } from 'react-i18next';

import langCN from './language/zh-CN'
import langEN from './language/en'


import {  loginUser }  from  './utils/api'

import axios from 'axios'
// axios.defaults.baseURL="http://49.4.114.124:8299"    


i18n
    .use(initReactI18next) // passes i18n down to react-i18next
    .init({
        // the translations
        // (tip move them in a JSON file and import them)
        resources: {
            en: {  //英文
                translation: langEN
            },
            zh: {   //中文
                translation: langCN
            }
        },
        // lng: getLanguage(),
        lng: 'en',
        fallbackLng: 'en',
        interpolation: {
            escapeValue: false
        }
    });


function AppP() {
    const { t } = useTranslation();
    React.translate = t;
    return ( < App/>
    );
}


ReactDOM.render( < AppP/> ,
    document.getElementById("root")
);